package com.tool;

/**
 * Created by lgq on 2016/10/17.
 */
public class Distance {

    static public double vector2D(double[] point1,double[] point2) {
        return Math.sqrt((point1[0] - point2[0])*(point1[0] - point2[0])
                + (point1[1] - point2[1])*(point1[1] - point2[1]));

    }

    static public double vector3D(double[] point1,double[] point2) {
        return Math.sqrt((point1[0] - point2[0])*(point1[0] - point2[0])
                + (point1[1] - point2[1])*(point1[1] - point2[1])
                + (point1[2] - point2[2])*(point1[2] - point2[2]));

    }

}
